//
//  MediaBrowseImagePreviewCell.swift
//  WatermarkCamera
//
//  Created by 赵新 on 6/7/2024.
//

import UIKit

// MARK: - [MediaBrowsePreviewCell]

class MediaBrowseImagePreviewCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        createUI()
    }

    @available(*, unavailable)
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    
    lazy var perview: ImageBrowsePreview = {
        let perview = ImageBrowsePreview()

        return perview
    }()

    /// 展示的图片
    var image: Image? {
        didSet { perview.configImage(image) }
    }

    override func layoutSubviews() {
        super.layoutSubviews()
    }

    func resetSubViewStatusWhenCellEndDisplay() {
        perview.scrollView.zoomScale = 0.5
    }

    func createUI() {
        backgroundColor = .black
        perview.frame = bounds
        addSubview(perview)
    }
}
